
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="zh_Hans">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Django 3.2.1 release notes &#8212; Django 3.2.6.dev 文档</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <link rel="index" title="索引" href="../genindex.html" />
    <link rel="search" title="搜索" href="../search.html" />
    <link rel="next" title="Django 3.2 release notes" href="3.2.html" />
    <link rel="prev" title="Django 3.2.2 release notes" href="3.2.2.html" />



 
<script src="../templatebuiltins.js"></script>
<script>
(function($) {
    if (!django_template_builtins) {
       // templatebuiltins.js missing, do nothing.
       return;
    }
    $(document).ready(function() {
        // Hyperlink Django template tags and filters
        var base = "../ref/templates/builtins.html";
        if (base == "#") {
            // Special case for builtins.html itself
            base = "";
        }
        // Tags are keywords, class '.k'
        $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
             var tagname = $(elem).text();
             if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
                 var fragment = tagname.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
             }
        });
        // Filters are functions, class '.nf'
        $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
             var filtername = $(elem).text();
             if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
                 var fragment = filtername.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
             }
        });
    });
})(jQuery);</script>

  </head><body>

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../index.html">Django 3.2.6.dev 文档</a></h1>
      <div id="global-nav">
        <a title="Home page" href="../index.html">Home</a>  |
        <a title="Table of contents" href="../contents.html">Table of contents</a>  |
        <a title="Global index" href="../genindex.html">Index</a>  |
        <a title="Module index" href="../py-modindex.html">Modules</a>
      </div>
      <div class="nav">
    &laquo; <a href="3.2.2.html" title="Django 3.2.2 release notes">previous</a>
     |
    <a href="index.html" title="Release notes" accesskey="U">up</a>
   |
    <a href="3.2.html" title="Django 3.2 release notes">next</a> &raquo;</div>
    </div>

    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="releases-3.2.1">
            
  <div class="section" id="s-django-3-2-1-release-notes">
<span id="django-3-2-1-release-notes"></span><h1>Django 3.2.1 release notes<a class="headerlink" href="#django-3-2-1-release-notes" title="永久链接至标题">¶</a></h1>
<p><em>May 4, 2021</em></p>
<p>Django 3.2.1 fixes a security issue and several bugs in 3.2.</p>
<div class="section" id="s-cve-2021-31542-potential-directory-traversal-via-uploaded-files">
<span id="cve-2021-31542-potential-directory-traversal-via-uploaded-files"></span><h2>CVE-2021-31542: Potential directory-traversal via uploaded files<a class="headerlink" href="#cve-2021-31542-potential-directory-traversal-via-uploaded-files" title="永久链接至标题">¶</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">MultiPartParser</span></code>, <code class="docutils literal notranslate"><span class="pre">UploadedFile</span></code>, and <code class="docutils literal notranslate"><span class="pre">FieldFile</span></code> allowed
directory-traversal via uploaded files with suitably crafted file names.</p>
<p>In order to mitigate this risk, stricter basename and path sanitation is now
applied.</p>
</div>
<div class="section" id="s-bugfixes">
<span id="bugfixes"></span><h2>Bugfixes<a class="headerlink" href="#bugfixes" title="永久链接至标题">¶</a></h2>
<ul class="simple">
<li>Corrected detection of GDAL 3.2 on Windows (<a class="reference external" href="https://code.djangoproject.com/ticket/32544">#32544</a>).</li>
<li>Fixed a bug in Django 3.2 where subclasses of <code class="docutils literal notranslate"><span class="pre">BigAutoField</span></code> and
<code class="docutils literal notranslate"><span class="pre">SmallAutoField</span></code> were not allowed for the <a class="reference internal" href="../ref/settings.html#std:setting-DEFAULT_AUTO_FIELD"><code class="xref std std-setting docutils literal notranslate"><span class="pre">DEFAULT_AUTO_FIELD</span></code></a>
setting (<a class="reference external" href="https://code.djangoproject.com/ticket/32620">#32620</a>).</li>
<li>Fixed a regression in Django 3.2 that caused a crash of
<code class="docutils literal notranslate"><span class="pre">QuerySet.values()/values_list()</span></code> after <code class="docutils literal notranslate"><span class="pre">QuerySet.union()</span></code>,
<code class="docutils literal notranslate"><span class="pre">intersection()</span></code>, and <code class="docutils literal notranslate"><span class="pre">difference()</span></code> when it was ordered by an
unannotated field (<a class="reference external" href="https://code.djangoproject.com/ticket/32627">#32627</a>).</li>
<li>Restored, following a regression in Django 3.2, displaying an exception
message on the technical 404 debug page (<a class="reference external" href="https://code.djangoproject.com/ticket/32637">#32637</a>).</li>
<li>Fixed a bug in Django 3.2 where a system check would crash on a reverse
one-to-one relationships in <code class="docutils literal notranslate"><span class="pre">CheckConstraint.check</span></code> or
<code class="docutils literal notranslate"><span class="pre">UniqueConstraint.condition</span></code> (<a class="reference external" href="https://code.djangoproject.com/ticket/32635">#32635</a>).</li>
<li>Fixed a regression in Django 3.2 that caused a crash of
<a class="reference internal" href="../ref/contrib/admin/index.html#django.contrib.admin.ModelAdmin.search_fields" title="django.contrib.admin.ModelAdmin.search_fields"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ModelAdmin.search_fields</span></code></a> when searching against phrases with
unbalanced quotes (<a class="reference external" href="https://code.djangoproject.com/ticket/32649">#32649</a>).</li>
<li>Fixed a bug in Django 3.2 where variable lookup errors were logged rendering
the sitemap template if alternates were not defined (<a class="reference external" href="https://code.djangoproject.com/ticket/32648">#32648</a>).</li>
<li>Fixed a regression in Django 3.2 that caused a crash when combining <code class="docutils literal notranslate"><span class="pre">Q()</span></code>
objects which contains boolean expressions (<a class="reference external" href="https://code.djangoproject.com/ticket/32548">#32548</a>).</li>
<li>Fixed a regression in Django 3.2 that caused a crash of <code class="docutils literal notranslate"><span class="pre">QuerySet.update()</span></code>
on a queryset ordered by inherited or joined fields on MySQL and MariaDB
(<a class="reference external" href="https://code.djangoproject.com/ticket/32645">#32645</a>).</li>
<li>Fixed a regression in Django 3.2 that caused a crash when decoding a cookie
value, used by <code class="docutils literal notranslate"><span class="pre">django.contrib.messages.storage.cookie.CookieStorage</span></code>, in
the pre-Django 3.2 format (<a class="reference external" href="https://code.djangoproject.com/ticket/32643">#32643</a>).</li>
<li>Fixed a regression in Django 3.2 that stopped the shift-key modifier
selecting multiple rows in the admin changelist (<a class="reference external" href="https://code.djangoproject.com/ticket/32647">#32647</a>).</li>
<li>Fixed a bug in Django 3.2 where a system check would crash on the
<a class="reference internal" href="../ref/settings.html#std:setting-STATICFILES_DIRS"><code class="xref std std-setting docutils literal notranslate"><span class="pre">STATICFILES_DIRS</span></code></a> setting with a list of 2-tuples of
<code class="docutils literal notranslate"><span class="pre">(prefix,</span> <span class="pre">path)</span></code> (<a class="reference external" href="https://code.djangoproject.com/ticket/32665">#32665</a>).</li>
<li>Fixed a long standing bug involving queryset bitwise combination when used
with subqueries that began manifesting in Django 3.2, due to a separate fix
using <code class="docutils literal notranslate"><span class="pre">Exists</span></code> to <code class="docutils literal notranslate"><span class="pre">exclude()</span></code> multi-valued relationships
(<a class="reference external" href="https://code.djangoproject.com/ticket/32650">#32650</a>).</li>
<li>Fixed a bug in Django 3.2 where variable lookup errors were logged when
rendering some admin templates (<a class="reference external" href="https://code.djangoproject.com/ticket/32681">#32681</a>).</li>
<li>Fixed a bug in Django 3.2 where an admin changelist would crash when deleting
objects filtered against multi-valued relationships (<a class="reference external" href="https://code.djangoproject.com/ticket/32682">#32682</a>). The
admin changelist now uses <code class="docutils literal notranslate"><span class="pre">Exists()</span></code> instead <code class="docutils literal notranslate"><span class="pre">QuerySet.distinct()</span></code>
because calling <code class="docutils literal notranslate"><span class="pre">delete()</span></code> after <code class="docutils literal notranslate"><span class="pre">distinct()</span></code> is not allowed in Django
3.2 to address a data loss possibility.</li>
<li>Fixed a regression in Django 3.2 where the calling process environment would
not be passed to the <code class="docutils literal notranslate"><span class="pre">dbshell</span></code> command on PostgreSQL (<a class="reference external" href="https://code.djangoproject.com/ticket/32687">#32687</a>).</li>
<li>Fixed a performance regression in Django 3.2 when building complex filters
with subqueries (<a class="reference external" href="https://code.djangoproject.com/ticket/32632">#32632</a>). As a side-effect the private API to check
<code class="docutils literal notranslate"><span class="pre">django.db.sql.query.Query</span></code> equality is removed.</li>
</ul>
</div>
</div>


          </div>
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Django 3.2.1 release notes</a><ul>
<li><a class="reference internal" href="#cve-2021-31542-potential-directory-traversal-via-uploaded-files">CVE-2021-31542: Potential directory-traversal via uploaded files</a></li>
<li><a class="reference internal" href="#bugfixes">Bugfixes</a></li>
</ul>
</li>
</ul>

  <h4>上一个主题</h4>
  <p class="topless"><a href="3.2.2.html"
                        title="上一章">Django 3.2.2 release notes</a></p>
  <h4>下一个主题</h4>
  <p class="topless"><a href="3.2.html"
                        title="下一章">Django 3.2 release notes</a></p>
  <div role="note" aria-label="source link">
    <h3>本页</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/releases/3.2.1.txt"
            rel="nofollow">显示源代码</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>快速搜索</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="转向" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">7月 23, 2021</p>
          </div>
        
      
    </div>

    <div id="ft">
      <div class="nav">
    &laquo; <a href="3.2.2.html" title="Django 3.2.2 release notes">previous</a>
     |
    <a href="index.html" title="Release notes" accesskey="U">up</a>
   |
    <a href="3.2.html" title="Django 3.2 release notes">next</a> &raquo;</div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>